home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / boss / boss_sup.lzh / WINBOSS.H < prev    next >
Text File  |  1992-03-04  |  25KB  |  715 lines

  1. /*
  2. ** WINDOW BOSS - Simple but Elegant Window Functions 
  3. **
  4. ** Lattice, Computer Innovations, Microsoft, Datalight, Aztec, 
  5. ** Watcom, Mix Power C, Zortech
  6. **
  7. ** Copyright (c) 1984, 1985, 1986 - Philip A. Mongelluzzo
  8. ** All rights reserved.
  9. **
  10. ** The complex web of compiler defines and feature tests follows.
  11. */
  12.  
  13. /*
  14. ** Computer Innovations comes first....
  15. */
  16.  
  17. #ifdef C86
  18. #define BORLAND 0
  19. #define MSCV3   0
  20. #define MSCV4   0
  21. #define MSCV6   0
  22. #define MSC     0
  23. #define MSC3    0
  24. #define MSC4    0
  25. #define DLC     0
  26. #define CI86    1
  27. #define LC2     0
  28. #define LC3     0
  29. #define LC6     0
  30. #define __ZTC__ 0
  31. #define __TSC__ 0
  32. #define MIXPC   0
  33. #define AZTEC   0
  34. #define WATCOM  0
  35. #ifdef _C86_BIG
  36. #define LPTR    1
  37. #define SPTR    0
  38. #else
  39. #define LPTR    0
  40. #define SPTR    1
  41. #endif
  42. #define LATTICE 0
  43. #define void int                        /* define void as int */
  44. struct WORDREGS {                       /* register layout is */
  45.         unsigned int ax;                /* different from the rest !! */
  46.         unsigned int bx;
  47.         unsigned int cx;
  48.         unsigned int dx;
  49.         unsigned int si;
  50.         unsigned int di;
  51.         unsigned int ds;                /* <= NB */
  52.         unsigned int es;                /* <= NB */
  53.         unsigned int flags;
  54.         };
  55. struct BYTEREGS {
  56.         unsigned char al, ah;
  57.         unsigned char bl, bh;
  58.         unsigned char cl, ch;
  59.         unsigned char dl, dh;
  60.         };
  61. union REGS {
  62.         struct WORDREGS x;
  63.         struct BYTEREGS h;
  64.         };
  65. struct SREGS {
  66.         unsigned int cs;
  67.         unsigned int ss;
  68.         unsigned int ds;
  69.         unsigned int es;
  70.         };
  71. extern unsigned wns_mtype();            /* make everyone happy */
  72. #endif                                  /* end C86 Stuff */
  73.  
  74. /*
  75. ** Watcom Stuff 
  76. */
  77.  
  78. #if WATCOM
  79. #pragma aux v_kstat "_*" parm caller []                           \
  80.                          value struct float struct routine [ax]   \
  81.                          modify [ax bx cx dx es]; 
  82.  
  83. #pragma aux xferdata "_*" parm caller []                           \
  84.                          value struct float struct routine [ax]   \
  85.                          modify [ax bx cx dx es]; 
  86.  
  87. #pragma aux v_border "_*" parm caller []                           \
  88.                          value struct float struct routine [ax]   \
  89.                          modify [ax bx cx dx es]; 
  90.  
  91. #pragma aux _vidblt "_*" parm caller []                           \
  92.                          value struct float struct routine [ax]   \
  93.                          modify [ax bx cx dx es]; 
  94. #endif
  95.  
  96. #if WATCOM                              /* HUGE memory stuff... */
  97. #ifdef M_I86HM                          /* new with ver 8.5 */
  98. #define SPTR    0
  99. #define LPTR    1
  100. #endif
  101. #endif
  102.  
  103. /*
  104. ** TopSpeed C
  105. */
  106.  
  107. #if __TSC__
  108. #define MSCV4   1
  109. #ifdef M_I86XM                          /* (XLARGE) large code, large data */
  110. #define SPTR    0
  111. #define LPTR    1
  112. #endif
  113. #ifdef M_I86MTM                         /* (MTHREAD) large code, large data */
  114. #define SPTR    0
  115. #define LPTR    1
  116. #endif
  117. #endif
  118.  
  119. /*
  120. ** Microsoft 4.0, 5.X, 6.X, QuickC, PowerC
  121. */
  122.  
  123.  
  124. #if MSCV6
  125. #undef NULL                             /* NULL must be redefined */
  126. #define NULL (int)0                     /* to avoid useless errors MSC 6.XX */
  127. #define MSCV4   1
  128. #endif
  129.  
  130. #if MSCV4
  131. #define MSC     1
  132. #define MSCV3   0
  133. #define MSC4    1
  134. #define DLC     0
  135. #define CI86    0
  136. #define LC2     0
  137. #define LC3     0
  138. #define BORLAND 0
  139. #ifndef MIXPC
  140. #define MIXPC   0
  141. #endif
  142. #define AZTEC   0
  143. #ifdef M_I86SM                          /* small code, small data */
  144. #define SPTR    1
  145. #define LPTR    0
  146. #endif
  147. #ifdef M_I86LM                          /* large code, large data */
  148. #define SPTR    0
  149. #define LPTR    1
  150. #endif
  151. #ifdef M_I86CM                          /* small code, large data */
  152. #define SPTR    0
  153. #define LPTR    1
  154. #endif
  155. #ifdef M_I86MM                          /* large code, small data */
  156. #define SPTR    1
  157. #define LPTR    0
  158. #endif
  159. #define LATTICE 1
  160. #endif
  161.  
  162. /*
  163. ** Microsoft 3.00
  164. */
  165.  
  166. #if MSCV3
  167. #define MSC     1
  168. #define MSC4    0
  169. #define DLC     0
  170. #define CI86    0
  171. #define LC2     0
  172. #define LC3     0
  173. #define BORLAND 0
  174. #define MIXPC   0
  175. #ifndef AZTEC
  176. #define AZTEC   0
  177. #endif
  178. #ifdef M_I86SM                          /* small code, small data */
  179. #define SPTR    1
  180. #define LPTR    0
  181. #endif
  182. #ifdef M_I86LM                          /* large code, large data */
  183. #define SPTR    0
  184. #define LPTR    1
  185. #endif
  186. #ifdef M_I86CM                          /* small code, large data */
  187. #define SPTR    0
  188. #define LPTR    1
  189. #endif
  190. #ifdef M_I86MM                          /* large code, small data */
  191. #define SPTR    1
  192. #define LPTR    0
  193. #endif
  194. #define LATTICE 1
  195. #endif
  196.  
  197. /*
  198. ** Lattice 6.XX
  199. */
  200.  
  201. #if LC6                                 /* Lattice 6 looks like BORLAND! */
  202. #define BORLAND 1                       /* from a code standpoint */
  203. #undef NULL                             /* NULL must be redefined */
  204. #define NULL (int)0                     /* to avoid useless errors */
  205. #endif                                  /* any changes here must also */
  206.                                         /* be made in "windows.c" */
  207.  
  208. /*
  209. ** Zortech
  210. */
  211.  
  212. #if __ZTC__                             /* ZORTECH looks like BORLAND! */
  213. #define BORLAND 1                       /* from a code standpoint */
  214. #undef NULL                             /* NULL must be undefined */
  215. #endif                                  /* any changes here must also */
  216.                                         /* be made in "windows.c" */
  217. /*
  218. ** BORLAND
  219. */
  220.  
  221. #ifdef __TURBOC__
  222. #ifndef BORLAND
  223. #define BORLAND 1
  224. #endif
  225. #endif
  226.  
  227. #if BORLAND
  228. #define MSC     1
  229. #define MSC4    1
  230. #define DLC     0
  231. #define CI86    0
  232. #define LC2     0
  233. #define LC3     0
  234. #define MIXPC   0
  235. #define AZTEC   0
  236. #ifdef __SMALL__                        /* small code, small data */
  237. #define SPTR    1
  238. #define LPTR    0
  239. #endif
  240. #ifdef __LARGE__                        /* large code, large data */
  241. #define SPTR    0
  242. #define LPTR    1
  243. #endif
  244. #ifdef __COMPACT__                      /* small code, large data */
  245. #define SPTR    0
  246. #define LPTR    1
  247. #endif
  248. #ifdef __MEDIUM__                       /* large code, small data */
  249. #define SPTR    1
  250. #define LPTR    0
  251. #endif
  252. #ifdef __HUGE__                         /* large code, large data */
  253. #define SPTR    0
  254. #define LPTR    1
  255. #endif
  256. #define LATTICE 1
  257. #endif
  258.  
  259. #define TRUE    1                       /* truth */
  260. #define FALSE   0                       /* lies */
  261. #define The_BOSS TRUE                   /* convienent equate */
  262.  
  263. #include "stdio.h"                      /* standard header */
  264. #if CI86
  265. char *malloc(), *calloc();              /* for the OLD TIMER */
  266. #else
  267. #include "stdlib.h"                     /* For the rest */
  268. #endif
  269. #if LC6
  270. #include "string.h"                     /* Now for Lattice 6.XX */
  271. #endif
  272.  
  273. #if BORLAND | MSC | DLC | LC2 | LC3 | MIXPC | WATCOM | CI86
  274. #if AZTEC
  275. #else
  276. #include "dos.h"                        /* Lattice stuff */
  277. #endif
  278. #endif
  279. #include "ctype.h"                      /* character conversion stuff */
  280. #if MSC4
  281. #include "stdarg.h"                     /* variable arg list marcos */
  282. #include "string.h"                     /* added 12/26/90 for Topspeed */
  283. #endif
  284.  
  285. #if AZTEC                               /* AZTEC DOS.H */
  286.  
  287. struct WORDREGS {
  288.     unsigned int ax;
  289.     unsigned int bx;
  290.     unsigned int cx;
  291.     unsigned int dx;
  292.     unsigned int si;
  293.     unsigned int di;
  294.     unsigned int cflag;
  295.     };
  296.  
  297. struct BYTEREGS {
  298.     unsigned char al, ah;
  299.     unsigned char bl, bh;
  300.     unsigned char cl, ch;
  301.     unsigned char dl, dh;
  302.     };
  303.  
  304. union REGS {
  305.     struct WORDREGS x;
  306.     struct BYTEREGS h;
  307.     };
  308.  
  309. struct SREGS {
  310.     unsigned int cs;
  311.     unsigned int ss;
  312.     unsigned int ds;
  313.     unsigned int es;
  314.     };
  315.  
  316. #define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
  317. #define FP_OFF(fp) (*((unsigned *)&(fp)))
  318.  
  319. struct RS {
  320.   int ax, bx, cx, dx, si, di, ds, es;
  321. };
  322. #endif                                  /* End AZTEC DOS.H